package com.last.controller;

import com.last.entity.Order;
import com.last.entity.PageDTO;
import com.last.entity.PageResult;
import com.last.entity.User;
import com.last.service.PersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/personal")
public class PersonalController {
    @Autowired
    private PersonalService personalService;
    @PostMapping("/userListOrder")
    public PageResult<Order> userListOrder(@RequestBody PageDTO<Order> pageDTO,int userId){
        return personalService.userListAllOrder(pageDTO,userId);
    }
    @PostMapping("/userListInformation")
    public PageResult<User> userListInformation(@RequestBody PageDTO<Order> pageDTO, int userId){
        return personalService.userListInformation(pageDTO,userId);
    }
}
